import 'package:flutter/material.dart';
import 'package:offical/widgets/TapBoxB.dart';

/// 演示父组件帮子组件管理状态
class ParentWidget extends StatefulWidget {
  @override
  _ParentWidgetState createState() => _ParentWidgetState();
}

class _ParentWidgetState extends State<ParentWidget> {
  bool _active = false;

  @override
  Widget build(BuildContext context) {
    return TapBoxB(
      active: _active,
      onChanged: _handleTapBoxChange,
    );
  }

  void _handleTapBoxChange(value) {
    setState(() {
      _active = value;
    });
  }
}
